#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from logisticRegressionAlgo import logRegress
import datetime
import numpy as np

dataArr, labelMat = logRegress.loadDataSet()

date1 = datetime.datetime.now()

out = logRegress.gradAscent(dataArr, labelMat)

date2 = datetime.datetime.now()
print (out)
print (date2 - date1)

#####
dataArr, labelMat = logRegress.loadDataSet()
weights = logRegress.gradAscent(dataArr, labelMat)
logRegress.plotBestFit(weights.getA())

###5-3
dataArr, labelMat = logRegress.loadDataSet()
weights = logRegress.stocGradAscent0(np.array(dataArr), labelMat)
logRegress.plotBestFit(weights)


### 5-4
dataArr, labelMat = logRegress.loadDataSet()
weights = logRegress.stocGradAscent1(np.array(dataArr), labelMat)
logRegress.plotBestFit(weights)


logRegress.multiTest()